<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %>

instances:
<% @instances.each do |i| -%>
  - host: <%= i['server'] || i['host'] %>
  <% (i.keys - ['host']).each do |key| -%>
    <%= key %>: <%= i[key] %>
  <% end -%>
    cassandra_aliasing: true
<% end -%>

<% if @version == 2 %>
init_config:
  # List of metrics to be collected by the integration
  # Read http://docs.datadoghq.com/integrations/java/ to learn how to customize it
  conf:
    - include:
        domain: org.apache.cassandra.metrics
        type: ClientRequest
        scope:
          - Read
          - Write
        name:
          - Latency
          - Timeouts
          - Unavailables
        attribute:
          - Count
          - OneMinuteRate
    - include:
        domain: org.apache.cassandra.metrics
        type: ClientRequest
        scope:
          - Read
          - Write
        name:
          - TotalLatency
    - include:
        domain: org.apache.cassandra.metrics
        type: Storage
        name:
          - Load
          - Exceptions
    - include:
        domain: org.apache.cassandra.metrics
        type: ColumnFamily
        bean_regex:
          - .*keyspace=.*
        name:
          - TotalDiskSpaceUsed
          - BloomFilterDiskSpaceUsed
          - BloomFilterFalsePositives
          - BloomFilterFalseRatio
          - CompressionRatio
          - LiveDiskSpaceUsed
          - LiveSSTableCount
          - MaxRowSize
          - MeanRowSize
          - MemtableColumnsCount
          - MemtableLiveDataSize
          - MemtableSwitchCount
          - MinRowSize
      exclude:
        keyspace:
          - OpsCenter
          - system
          - system_auth
          - system_distributed
          - system_schema
          - system_traces
    - include:
        domain: org.apache.cassandra.metrics
        type: Cache
        name:
          - Capacity
          - Size
        attribute:
          - Value
    - include:
        domain: org.apache.cassandra.metrics
        type: Cache
        name:
          - Hits
          - Requests
        attribute:
          - Count
    - include:
        domain: org.apache.cassandra.metrics
        type: ThreadPools
        path: request
        name:
          - ActiveTasks
          - CompletedTasks
          - PendingTasks
          - CurrentlyBlockedTasks
    - include:
        domain: org.apache.cassandra.db
        attribute:
          - UpdateInterval
<% else %>
# List of metrics to be collected.
init_config:
  conf:
    - include:
        domain: org.apache.cassandra.db
        attribute:
          - BloomFilterDiskSpaceUsed
          - BloomFilterFalsePositives
          - BloomFilterFalseRatio
          - Capacity
          - CompletedTasks
          - CompressionRatio
          - ExceptionCount
          - Hits
          - KeyCacheRecentHitRate
          - LiveDiskSpaceUsed
          - LiveSSTableCount
          - Load
          - MaxRowSize
          - MeanRowSize
          - MemtableColumnsCount
          - MemtableDataSize
          - MemtableSwitchCount
          - MinRowSize
          - PendingTasks
          - ReadCount
          - RecentHitRate
          - RecentRangeLatencyMicros
          - RecentReadLatencyMicros
          - RecentWriteLatencyMicros
          - Requests
          - RowCacheRecentHitRate
          - Size
          - TotalDiskSpaceUsed
          - TotalReadLatencyMicros
          - TotalWriteLatencyMicros
          - UpdateInterval
          - WriteCount
      exclude:
        keyspace: system
    - include:
        domain: org.apache.cassandra.internal
        attribute:
          - ActiveCount
          - CompletedTasks
          - CurrentlyBlockedTasks
          - TotalBlockedTasks
    - include:
        domain: org.apache.cassandra.net
        attribute:
          - TotalTimeouts
<% end %>
